#pragma once
#include"AbstractLayer.h"

class b2Body;
class BirdImpluseContactListener;
class BirdThrower;

class BirdImpluse : public AbstractLayer
{
public:
	friend class BirdImpluseContactListener;

	createScene(BirdImpluse)

	CREATE_FUNC(BirdImpluse)

	bool init();
	
	void box2DAppReady() override;

	virtual bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *unused_event) override;

	virtual void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *unused_event) override;
	 
	virtual void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *unused_event) override;

	virtual void update(float dt) override;
private:
	b2Body * bird;
	b2Body* stone;
	BirdImpluseContactListener* listener;
	BirdThrower* birdManager;
};
